<template>
	<my-ref
		v-if="table"
		url="/dev/data-enum/list"
		v-model="table"
		@loaded="procData"
		:multi="$props.multi"
		:page-size="10"
		ref="list"
		name="Api枚举"
		:store="true"
		v-bind="$attrs"
		@change="v=>$emit('change',v)"
		:readOnly="$props.readOnly"
	>
		<el-table-column label="name" align="center">
			<template v-slot="scope">
				{{ scope.row.name }}
			</template>
		</el-table-column>
		<el-table-column align="center" label="字段" prop="items"></el-table-column>
		<el-table-column align="center" label="remark" prop="remark"></el-table-column>
		<template #query="scope">
		</template>
		<template #button>
			<el-button>选择Api枚举</el-button>
		</template>
	</my-ref>
</template>

<script setup>
/**
 * Created by CodeGenerator at 2023-10-19 08:13:36
 */



defineOptions({
    name: "ref-data-enum",
    inheritAttrs: true,
});

//定义 vue2的this,当前组件
const $self = getCurrentInstance();

//定义 $attrs
const $attrs = useAttrs();



//定义data
const $data = reactive({});


const $props = defineProps({
    readOnly : { type: Boolean },
    multi : { type: Boolean }
});


const $model = defineModel({ type: [Object,Array] });



const list = ref();

//定义事件
const $emit = defineEmits(["update:modelValue","loaded"]);

const table = $computed({ get() {
        return $model;
    },set(folders){
        var v = Object.assign({}, folders);
        $emit("update:modelValue", v);
    } });

const procData = function(res, op) {
    let json = res.data.data;
    json.forEach(it => {
//如果是组合实体，设置 it.id=...
    });
};





</script>

<style scoped lang="scss">
</style>